<?php 
# 文件名称:fdlist.view.php
# MetInfo在线反馈系统 
# Copyright (C) 长沙米拓信息技术有限公司 (http://www.metinfo.cn). All rights reserved.
class fdlistView extends C_view
{
	function fdlistView()
	{
		parent::C_view();
	}
	//加载模板
	function display($tpl)
	{		
		$SYS = &get_instance();
		$this->assignRef('message', $SYS->loader->getMessageQueue());
		$SYS->html->script('core.js');		
		switch($tpl)
		{			
			case 'add':
			case 'edit':	
							if( $tpl=='add' )
							{
								$this->assignRef( 'title', C_text::_('add'));
								$this->assignRef( 'subTitle',C_text::_('AddList'));
								$SYS->request->setVar( 'cid', array(0));
								$this->assign('apply', "add");
							}else
							{
								$this->assignRef( 'title', C_text::_('edit'));
								$this->assignRef( 'subTitle',C_text::_('EditList'));
								$this->assign('apply', "edit");
							}														
							$this->assignRef('item', $this->get('Item'));
							$this->assignRef('itemfield', $this->get('Itemfield'));
							$this->getJS();
							parent::display('fdlist_edit');break;
			default:
							$this->assignRef( 'title', C_text::_('manager'));
							$this->assignRef( 'items', $this->get('Items'));
							$this->assignRef( 'lists', $this->get('Lists'));
							$this->assignRef( 'pagination', $this->get('Pagination'));
							$js_content="markRows();";
							$SYS->doc->addScriptDeclaration($js_content);
							parent::display('fdlist');
		}
	}
	//加载js库
	function getJS()
	{
		$SYS = &get_instance();
		$js_content="		
		function submitbutton(pressbutton) {
			var form = document.adminForm;
			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			var flag = false;
			$$('.must').each(function(el) {
				if(el.get('value')!='')
					flag=true;
			});
			// do field validation
			if (trim(form.no_order.value) == '') {
				alert( '".C_text::_('Item1').C_text::_('Item5')."');
			} else if (!flag) {
				alert('".C_text::_('Must')."');
			} else {
				submitform( pressbutton );
			}
		}
		window.addEvent('domready', function(){ 
				new Accordion($$('.pane-toggler'), 
				$$('.pane-slider'), 
				{
					onActive: function(toggler, i) 
					{ 
						toggler.addClass('pane-toggler-down');toggler.removeClass('pane-toggler'); 
					},
					onBackground: function(toggler, i) 
					{ 
						toggler.addClass('pane-toggler'); toggler.removeClass('pane-toggler-down'); 
					},
					duration: 300,opacity: false,alwaysHide: true
				}); 
			});
		";
		$SYS->doc->addScriptDeclaration($js_content);
		$SYS->html->script('mootools-more.js');
	}
}
# 本程序是一个开源系统,使用时请你仔细阅读使用协议,商业用途请自觉购买商业授权.
# Copyright (C) 长沙米拓信息技术有限公司 (http://www.metinfo.cn). All rights reserved.
?>